<template>
  <div class="app-container home">
    <el-row :gutter="20">
      <el-col :sm="24" :lg="12" style="padding-left: 20px">
        <h2>若依后台管理框架 (Node.js版)</h2>
        <p>
          作为一名开发者，我一直想深入学习Node.js和Express，于是决定通过重构一个实际项目来提升自己的技能。在尝试了几个开源项目后，我选择了若依管理系统作为重构对象，将其后端从传统架构迁移到Node.js + TypeScript + Express的技术栈。这个过程不仅让我对Node.js的非阻塞特性和Express的路由机制有了更深入的理解，还体会到了TypeScript带来的类型安全优势。这个重构版本保留了原系统的核心功能，同时在性能和开发体验上有了明显提升。它适用于各类Web应用场景，如企业内部系统、内容管理平台、客户管理系统等。代码结构清晰简洁，易于理解和扩展，非常适合想要学习Node.js全栈开发的朋友参考。我会持续完善这个项目，也欢迎各位一起交流学习。
        </p>
        <p>
          <b>当前版本:</b> <span>v{{ version }}</span>
        </p>
        <p>
          <el-tag type="success">Node.js + TypeScript 重构版</el-tag>
          <el-tag type="danger" style="margin-left: 8px">&yen;免费开源</el-tag>
        </p>
        <!-- <p>
          <el-button
            type="primary"
            icon="Cloudy"
            plain
            @click="goTarget('https://gitee.com/y_project/RuoYi-Vue')"
            >访问码云</el-button
          >
          <el-button
            icon="HomeFilled"
            plain
            @click="goTarget('http://ruoyi.vip')"
            >访问主页</el-button
          >
        </p> -->
      </el-col>

      <el-col :sm="24" :lg="12" style="padding-left: 50px">
        <el-row>
          <el-col :span="12">
            <h2>技术选型</h2>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <h4>后端技术</h4>
            <ul>
              <li>Node.js</li>
              <li>Express.js</li>
              <li>TypeScript</li>
              <li>Sequelize</li>
              <li>MySQL</li>
              <li>Redis</li>
              <li>JWT</li>
            </ul>
          </el-col>
          <el-col :span="6">
            <h4>前端技术</h4>
            <ul>
              <li>Vue3</li>
              <li>Pinia</li>
              <li>Element Plus</li>
              <li>Axios</li>
              <li>Vite</li>
              <li>Sass</li>
              <li>...</li>
            </ul>
          </el-col>
        </el-row>
      </el-col>
    </el-row>
    
    <el-divider />
    
    <!-- Node.js版本特性介绍 -->
    <el-row :gutter="20" style="margin-bottom: 20px">
      <el-col :span="24">
        <h3>Node.js版本特性</h3>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="6">
        <el-card shadow="hover" class="feature-card">
          <template #header>
            <div class="feature-header">
              <i class="el-icon-cpu"></i>
              <span>类型安全</span>
            </div>
          </template>
          <div class="feature-content">
            基于TypeScript开发，提供完整的类型定义，减少运行时错误，提高代码质量和可维护性。
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="6">
        <el-card shadow="hover" class="feature-card">
          <template #header>
            <div class="feature-header">
              <i class="el-icon-lightning"></i>
              <span>高性能</span>
            </div>
          </template>
          <div class="feature-content">
            基于Node.js的非阻塞I/O模型，处理并发请求更高效，适合高并发场景下的API服务。
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="6">
        <el-card shadow="hover" class="feature-card">
          <template #header>
            <div class="feature-header">
              <i class="el-icon-connection"></i>
              <span>ORM支持</span>
            </div>
          </template>
          <div class="feature-content">
            集成Sequelize ORM，支持多种数据库，提供强大的数据模型定义、查询构建和关联关系。
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="12" :md="8" :lg="6">
        <el-card shadow="hover" class="feature-card">
          <template #header>
            <div class="feature-header">
              <i class="el-icon-monitor"></i>
              <span>监控系统</span>
            </div>
          </template>
          <div class="feature-content">
            内置Prometheus监控指标收集，支持系统资源监控、性能分析和告警通知。
          </div>
        </el-card>
      </el-col>
    </el-row>
    
    <el-row :gutter="20">
      <el-col :xs="24" :sm="24" :md="12" :lg="12">
        <el-card class="update-log">
          <template v-slot:header>
            <div class="clearfix">
              <span>联系信息</span>
            </div>
          </template>
          <div class="body">
            <p>
              <i class="el-icon-s-promotion"></i> 官网：<el-link
                href="http://www.ruoyi.vip"
                target="_blank"
                >http://www.ruoyi.vip</el-link
              >
            </p>
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="12">
        <el-card class="update-log">
          <template v-slot:header>
            <div class="clearfix">
              <span>更新日志</span>
            </div>
          </template>
          <el-collapse accordion>
            <el-collapse-item title="v1.0.0 - 2025-07-01">
              <ol>
                <li>Node.js + TypeScript重构版本首次发布</li>
                <li>完整实现若依系统的核心功能</li>
                <li>基于Express.js框架开发RESTful API</li>
                <li>使用Sequelize ORM支持多种数据库</li>
                <li>集成JWT实现无状态身份验证</li>
                <li>支持文件上传和图像处理</li>
                <li>实现定时任务调度系统</li>
                <li>集成日志管理和系统监控</li>
                <li>提供完整的权限控制和数据权限</li>
                <li>支持Docker容器化部署</li>
                <li>多环境配置支持</li>
                <li>API限流和安全防护</li>
                <li>异步任务处理</li>
                <li>缓存管理</li>
                <li>其他细节优化</li>
              </ol>
            </el-collapse-item>
          </el-collapse>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script setup name="Index">
const version = ref('1.0.0')

function goTarget(url) {
  window.open(url, '__blank')
}
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }
  
  h3 {
    font-size: 22px;
    font-weight: 300;
    margin-bottom: 20px;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
  
  .feature-card {
    height: 100%;
    margin-bottom: 20px;
    transition: all 0.3s;
    
    &:hover {
      transform: translateY(-5px);
      box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    
    .feature-header {
      display: flex;
      align-items: center;
      
      i {
        margin-right: 8px;
        font-size: 18px;
        color: #409EFF;
      }
      
      span {
        font-weight: 500;
      }
    }
    
    .feature-content {
      color: #606266;
      font-size: 14px;
      line-height: 1.6;
    }
  }
}
</style>

